package php;
import php.Session;


/**
 * ...
 * @author Axel Huizinga axel@cunity.me
 */

class Cart 
{
	
	
	var items:Hash<Int>;
	
	public function new(data:Xml) 
	{
		items = new Hash();
		Session.set('items', items);
	}
	
	function  add(id:String, count:Int)
	{
		var current:Null<Int> = items.get(id);
		current = (current == null) ? count : current + count;
		items.set(id, current);
		Session.set('items', items);
		
	}
	
}